home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 2
/
Gold Medal Software Volume 2 (Gold Medal) (1994).iso
/
netutils
/
nbdriv.arj
/
SHOWDDH.C
< prev
next >
Wrap
Text File
|
1993-10-26
|
1KB
|
61 lines
#include <dos.h>
#include <conio.h>
#include <stdio.h>
#include <compat.h>
struct DDH_struct
{
struct DDH_struct far *next_DDH;
unsigned int ddh_attribute;
unsigned int ddh_strategy;
unsigned int ddh_interrupt;
unsigned char ddh_name[8];
};
struct DOS_struct
{
unsigned char reserved[34];
struct DDH_struct far *ddh_ptr;
};
void main(void);
void PrintDDH(struct DDH_struct far *);
void PrintDDH(struct DDH_struct far *ddh_ptr)
{
struct DDH_struct far *z;
unsigned int i;
z = ddh_ptr;
printf("Entry Next Attr Strat Intr Name\n");
printf("--------------------------------------------\n");
while (FP_OFF(z) != 0xffff)
{
printf("%Fp %Fp %04x %04x %04x ",z,z->next_DDH,z->ddh_attribute,
z->ddh_strategy,z->ddh_interrupt);
for (i=0; i < 8; i++)
{
if (z->ddh_name[i] > 0x1f)
{
putchar(z->ddh_name[i]);
}
}
putchar(13);
putchar(10);
z=z->next_DDH;
}
}
void main()
{
struct DOS_struct far *dos_ptr;
union REGS in_regs, out_regs;
struct SREGS seg_regs;
segread(&seg_regs);
in_regs.x.ax = 0x5200;
int86x(0x21,&in_regs,&out_regs,&seg_regs);
dos_ptr = MK_FP(seg_regs.es,out_regs.x.bx);
PrintDDH((struct DDH_struct far *)dos_ptr->ddh_ptr);
}